/*
 * Copyright 2011 CraneLeeon authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.crane.webtemplate.exception;

import org.crane.webtemplate.Tokens;
import org.crane.webtemplate.Tokens;

/**
 *
 * @author CraneLeeon
 */
public class TextMessageException extends Exception{
    private String suffixMessage;
    private String prefixMessage;
    private int errCode = Tokens.ERR_UNKNOWN;

    public TextMessageException(Throwable cause) {
        super(cause);
    }

    public int getErrCode() {
        return errCode;
    }

    public TextMessageException addErrCode(int errCode) {
        this.errCode = errCode;
        return this;
    }

    public TextMessageException(String message, Throwable cause) {
        super(message, cause);
    }

    public TextMessageException(String message) {
        super(message);
    }

    public TextMessageException() {
        super();
    }

    public String getPrefixMessage() {
        return prefixMessage;
    }

    public TextMessageException addPrefixMessage(String prefixMessage) {
        this.prefixMessage = prefixMessage;
        return this;
    }

    public String getSuffixMessage() {
        return suffixMessage;
    }

    public TextMessageException addSuffixMessage(String suffixMessage) {
        this.suffixMessage = suffixMessage;
        return this;
    }

}
